<?php /* Smarty version Smarty-3.1.18, created on 2017-05-17 08:17:48
         compiled from "/data/www/mystery/protected/modules/webadmin/views/project/add.tpl" */ ?>
<?php /*%%SmartyHeaderCode:140180179954c4c64c8baf67-64912133%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '446e6d291273efef77f107618302b9b4c5992cc6' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/project/add.tpl',
      1 => 1494904923,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '140180179954c4c64c8baf67-64912133',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54c4c64c960110_71349484',
  'variables' => 
  array (
    'info' => 0,
    'network_level_one' => 0,
    'key' => 0,
    'val' => 0,
    'group_list' => 0,
    'v' => 0,
    'user_list' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54c4c64c960110_71349484')) {function content_54c4c64c960110_71349484($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<script type="text/javascript" src='/js/datepicker/WdatePicker.js'></script>
<table width="100%" border="0" cellspacing="0">
 <tr>
       <td width="13%" valign="top">
           <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

       </td>
       <td width="87%" valign="top">

               <table width="100%" border="0" cellspacing="0">
                 <tr>
                    <td>
                        <div class="subnav">
                          <div class="content-menu ib-a blue line-x"> <a href="javascript:void(0);" class="on"><em><?php if ($_smarty_tpl->tpl_vars['info']->value) {?>编辑项目<?php } else { ?>添加项目<?php }?></em></a></div>
                        </div>
                        <div class="pad_10">
                          <div class="table-list">
                                <div class="common-form">
                                    <form name="myform" id="myform" action="<?php if ($_smarty_tpl->tpl_vars['info']->value) {?>/webadmin/project/doEdit<?php } else { ?>/webadmin/project/doAdd<?php }?>" method="post" id="myform">
                                    <table width="100%" class="table_form contentWrap">
                                    <tbody>
                                    <tr>
                                        <td width="80">项目编号</td> 
                                        <td colspan="3"><input type="text" name="project_num" id="project_num" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['project_num'];?>
" class="input-text" ></td>
                                    </tr>
                                    <tr>
                                        <td width="80">项目名称</td> 
                                        <td colspan="3"><input type="text" name="project_name" id="project_name" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['project_name'];?>
" class="input-text"></td>
                                    </tr>
                                    <tr>
                                        <td width="80">通知邮箱</td> 
                                        <td colspan="3"><input type="text" name="email" id="email" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['email'];?>
" class="input-text">(超大附件联系邮箱)</td>
                                    </tr>
                                    <tr>
                                        <td width="80">项目所有者</td>
                                        <td colspan="3">
                                            <select name="up_network_id" id="bank_id" onchange="getnetwork(this.value);">
                                                <option>==请选择总行==</option>
                                                <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['network_level_one']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                                <option value="<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['info']->value['up_network_id']==$_smarty_tpl->tpl_vars['key']->value) {?>selected="selected"<?php }?>><?php echo $_smarty_tpl->tpl_vars['val']->value;?>
</option>
                                                <?php } ?>
                                            </select>
                                            <select name="network_id" id="network_id">
                                                <option value="0">==请选择分行==</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="80">项目启动时间</td> 
                                        <td colspan="3">
                                            <input type="text" name="start_time" id="d4311" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['start_time'];?>
" class="input-text" onClick="WdatePicker()"  id="start_time">
                                        项目结束时间
                                        <input type="text" name="end_time" id="d4312" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['end_time'];?>
" class="input-text" onClick="WdatePicker({minDate:'#F{$dp.$D(\'d4311\')}'})"  id="end_time">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="80">调查范围</td>
                                        <td width="100">
                                            <textarea name="scope" id="scope" rows="5" cols="60"><?php echo $_smarty_tpl->tpl_vars['info']->value['scope'];?>
</textarea>
                                        </td>
                                        <td width="80">调查方法</td>
                                        <td>
                                            <textarea name="method" id="method"  rows="5" cols="60"><?php echo $_smarty_tpl->tpl_vars['info']->value['method'];?>
</textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                      <td>项目背景</td>
                                      <td colspan="3"><textarea name="background" id="background" rows="5" cols="60"><?php echo $_smarty_tpl->tpl_vars['info']->value['background'];?>
</textarea></td>
                                     </tr>
                                    <tr>
                                        <td bgcolor="#F9F9F9">分配管理员 </td>
                                        <td colspan="3"><table width="100%" border="0" cellspacing="0">
                                                <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['group_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                                <tr>
                                                  <td bgcolor="#F9F9F9"><strong><?php echo $_smarty_tpl->tpl_vars['val']->value['group_name'];?>
</strong></td>
                                                </tr>
                                                <?php if ($_smarty_tpl->tpl_vars['val']->value['user']) {?>
                                                <tr>
                                                    <td>
                                                      <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['val']->value['user']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                                                      <input name="user_id[]" type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['user_id'];?>
" <?php if ($_smarty_tpl->tpl_vars['user_list']->value) {?><?php if (in_array($_smarty_tpl->tpl_vars['v']->value['user_id'],$_smarty_tpl->tpl_vars['user_list']->value)) {?>checked="checked"<?php }?><?php }?>><?php echo $_smarty_tpl->tpl_vars['v']->value['truename'];?>

                                                      <?php } ?>
                                                    </td>
                                                </tr>
                                                <?php }?>
                                                <?php } ?>
                                            </table>
                                        </td>
                                    </tr>
                                    </tbody>
                                    </table>
                                    <div class="bk15"></div>
                                    <input name="project_id" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['project_id'];?>
"/>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input name="dosubmit" type="submit" value="提交" class="button">
                                    </form>
                                    </div>
                          </div>
                        </div>

                    </td>
                 </tr>
               </table>
       </td>
 </tr>
</table>
<script type="text/javascript">
    $(function(){
        $('#project_num').blur(function(){
            var project_num = $(this).val();
            if (project_num != '') {
                $.getJSON('/webadmin/project/Check',{project_num:project_num,project_id:<?php echo intval($_smarty_tpl->tpl_vars['info']->value['project_id']);?>
},function(res){
                    if (res.status==1) {
                        alert(res.note);
                        $(this).focus();
                    }
                });
            }
        });
        $('#project_name').blur(function(){
            var project_name = $(this).val();
            if (project_name != '') {
                $.getJSON('/webadmin/project/Check',{project_name:project_name,project_id:<?php echo intval($_smarty_tpl->tpl_vars['info']->value['project_id']);?>
},function(res){
                    if (res.status==1) {
                        alert(res.note);
                        $(this).focus();
                    }
                });
            }
        });
    })
    var up_network_id = $('#bank_id').val();
    if (up_network_id) {
        getnetwork(up_network_id);
    }
    function getnetwork(up_network_id){
        $.getJSON('/webadmin/network/getnet',{up_network_id:up_network_id}, function(res){
            var html = '<option value="0">==请选择分行==</option>';
            if (res.status == 1) {
                $.each(res.data, function(i, v){
                    if (<?php echo intval($_smarty_tpl->tpl_vars['info']->value['network_id']);?>
 && <?php echo intval($_smarty_tpl->tpl_vars['info']->value['network_id']);?>
==i) {
                        html += '<option value="'+i+'" selected="selected">'+v+'</option>'
                    } else {
                        html += '<option value="'+i+'">'+v+'</option>'
                    }
                    
                });
                $('#network_id').html(html);
            }
        });
    }
    $('#myform').submit(function(){
        var bank_id = $('#bank_id').val();
        if (!bank_id) {
            alert('项目所属行必须选择一项');
            return false;
        }
        var project_num = $('#project_num').val();
        if (project_num=='') {
            alert('项目编号不能为空');
            $('#project_num').focus();
            return false;
        }
        var email = $('#email').val();
        var email_reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[-|_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        if (email!='' && !email_reg.test(email)) {
            alert('通知邮箱不能为空');
            $('#email').focus();
            return false;
        }
        var project_name = $('#project_name').val();
        if (project_name=='') {
            alert('项目名称不能为空');
            $('#project_name').focus();
            return false;
        }
        var d4311 = $('#d4311').val();
        var d4312 = $('#d4312').val();
        if (d4311 == '') {
            alert('开始时间不能为空');
            return false;
        }
        if (d4312 == '') {
            alert('结束时间不能为空');
            return false;
        }
        return true;
    });
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
